@echo off

chcp 65001

:: 设置Python路径(修改为实际路径)
set "PYTHON_PATH=%~dp0..\python\python.exe"

:: 设置 PATH 以包含虚拟环境的 Scripts 目录
set "PATH=%~dp0..\python\Scripts;%PATH%"

:: 检查Python路径是否存在
if not exist "%PYTHON_PATH%" (
    echo 错误: Python解释器不存在于 %PYTHON_PATH%
    echo 请修改PYTHON_PATH变量为正确的路径
    pause
    exit /b 1
)

:: 执行安装脚本
echo 正在使用Python路径: %PYTHON_PATH%
"%PYTHON_PATH%" "%~dp0install_nunchaku.py" --python-path "%PYTHON_PATH%"

if %errorlevel% neq 0 (
    echo 安装失败，错误代码: %errorlevel%
    pause
    exit /b %errorlevel%
)

echo 安装成功完成
pause

